<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>修改信息</title>

    <style>
        *{
            text-align: center;
        }
        .con {
          width: 400px;
          margin: 0 auto;
          padding: 30px;
          border: 1px solid blue;
        }
      </style>
</head>
<body>
    <div class="con">
        <h1>修改学生信息</h1>
        <form action="" method="post">
          <input type="hidden" name="id" id="id" value="">
          <p>
            <label for="class"> 班级：</label>
            <input type="text" name="clazz" id="clazz" />
          </p>
          <p>
            <label for="name">姓名：</label>
            <input type="text" name="name" id="name" />
          </p>
          <p>
            <label for="gender">性别：</label>
            <input type="radio" name="gender" value="男" checked />男
            <input type="radio" name="gender" value="女" />女
          </p>
          <p>
            <label for="age">年龄：</label>
            <input type="text" name="age" id="age" />
          </p>
          <p>
            <label for="hobby">爱好：</label>
            <input type="checkbox" name="hobby" value="吃饭" /> 吃饭
            <input type="checkbox" name="hobby" value="睡觉" />睡觉
            <input type="checkbox" name="hobby" value="学习" />学习
          </p>
          <p>
            <label for="tel"> 手机号：</label><input type="text" name="tel" id="tel" />
          </p>
          <p>
            <label for="address"> 地址：</label>
            <select name="address" id="">
              <option value="郑州">郑州</option>
              <option value="洛阳">洛阳</option>
              <option value="新乡">新乡</option>
            </select>
          </p>
          <p>
            <label for="remark"> 备注：</label>
            <textarea name="remark" id="remark" cols="30" rows="10"></textarea>
          </p>
          <p>
            <label for="date">入学时间：</label>
            <input type="date" name="date" id="date" />
          </p>
          <p>
            <input type="submit" value="提交"   />
          </p>
          <p></p>
        </form>
      </div>


      <script src="js/utils.js"></script>
      <script>
        var id=window.location.hash.substring(1);
        console.log(id);
          
        huixian("http://localhost:3008/api/student/getStudent?id="+id)



        var form=document.querySelector('form')
                                    
        form.onsubmit=function(e){
            e.preventDefault();//阻止表单跳转
            var data=serializeKeyValue(this);
            console.log(data);
            MyPostDate("http://localhost:3008/api/student/updateStudent",data)
        } 
        
        
					






      </script>






</body>
</html>